package com.evan.review.architecture.components.navigation;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.navigation.NavDirections;

import com.evan.review.R;

/**
 * HomeFragment导航方向类
 * 注意：通常这个类是由Navigation Safe Args插件自动生成的
 * 这里手动创建是为了演示其工作原理
 */
public class HomeFragmentDirections {

    /**
     * 从HomeFragment到DetailFragment的导航动作
     */
    public static ActionHomeFragmentToDetailFragment actionHomeFragmentToDetailFragment() {
        return new ActionHomeFragmentToDetailFragment();
    }

    /**
     * 导航动作实现类
     */
    public static class ActionHomeFragmentToDetailFragment implements NavDirections {

        private int itemId = 0;

        public ActionHomeFragmentToDetailFragment setItemId(int itemId) {
            this.itemId = itemId;
            return this;
        }

        @Override
        public int getActionId() {
            return R.id.action_homeFragment_to_detailFragment;
        }

        @NonNull
        @Override
        public Bundle getArguments() {
            return new Bundle();
        }

        public int getItemId() {
            return itemId;
        }
    }
} 